package gooner.suntine.ssh.eg.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * @corporation 
 * @author suntine
 * @creation 2011-5-5 06:08:18 PM
 * @description 
 */
public class ApplicationContextUtils implements ApplicationContextAware{
	
	private static ApplicationContext context;

	@Override
	public void setApplicationContext(ApplicationContext ac)throws BeansException {
		context = ac;
	}
	
	public static ApplicationContext getContext(){
		return context;
	}
	
	public static Object getBean(String bean){
		return context.getBean(bean);
	}
}
